<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/5/17
  Time: 10:10
  To change this template use File | Settings | File Templates.
--%>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/5/3
  Time: 16:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <title>管理员页面</title>
    <link rel="icon" href="<c:url value="/login.jpeg"/>"/>
    <link rel="stylesheet" href="<c:url value="/webjars/bootstrap/4.3.1/css/bootstrap.min.css"/>"/>
    <script src="<c:url value="/webjars/jquery/3.0.0/jquery.min.js"/>"></script>
    <link href="/docs/4.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
    <link rel="stylesheet" href="<c:url value="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>">
</head>

<style>
    .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
    }

    @media (min-width: 768px) {
        .bd-placeholder-img-lg {
            font-size: 3.5rem;
        }
    }
</style>

<link href="/webshool/css/manager.css" rel="stylesheet">

<body>
    <nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
        <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">
            管理员页面———欢迎您：
            <span class="user"style="font: small 幼圆">
                <c:out value="${realUserName}"/>
            </span>
        </a>
        <input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
        <ul class="navbar-nav px-3">
            <li class="nav-item text-nowrap">
                <a class="nav-link" href="<c:url value="/manager/logout"/>">注销</a>
            </li>
        </ul>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <nav class="col-md-2 d-none d-md-block bg-light sidebar">
                <div class="sidebar-sticky">
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link active" href="#">
                                <span data-feather="home"></span>
                                统计视图 <span class="sr-only">(current)</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <span data-feather="file"></span>
                                学生信息
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="<c:url value="/manager/user/list"/>">
                                <span data-feather="file-text"></span>
                                用户管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <span data-feather="users"></span>
                                学生管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <span data-feather="bar-chart-2"></span>
                                签到信息
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <span data-feather="layers"></span>
                                信息查询
                            </a>
                        </li>
                    </ul>

                    <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
                        <span>Saved reports</span>
                        <a class="d-flex align-items-center text-muted" href="#">
                            <span data-feather="plus-circle"></span>
                        </a>
                    </h6>
                </div>
            </nav>
            <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
                <h3>
                    用户信息
                    <a href="<c:url value="/manager/user/new"/>" class="btn btn-outline-secondary">新增用户</a>
                </h3>
                <c:if test="${sessionScope.msg != null}">
                    <div class="alert alert-primary" role="alert">
                        <c:out value="${sessionScope.msg}"/>
                        <c:remove var="msg" scope="session"/>
                    </div>
                </c:if>

                <div class="table-responsive">
                    <table class="table table-striped table-sm" style="text-align: center">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>登录名</th>
                                <th>真实姓名</th>
                                <th>密码</th>
                                <th>登录次数</th>
                                <th>最后登陆时间</th>
                                <th>更改/删除</th>
                            </tr>
                        <c:forEach items="${managers}" var="model">
                            <tr>
                                <td><c:out value="${model.id}"/></td>
                                <td><c:out value="${model.loginid}"/></td>
                                <td><c:out value="${model.realname}"/></td>
                                <td><c:out value="********"/></td>
                                <td><c:out value="${model.logincount}"/></td>
                                <td>
                                    <fmt:formatDate value="${model.logindate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </td>
                                <td>
                                    <a type="button" class="btn btn-primary" href="<c:url value="/manager/user/edit?id=${model.id}"/>">更改</a>
                                    <a type="button" class="btn btn-warning" href="<c:url value="/manager/user/delete?id=${model.id}"/>" onclick="return confirm('是否确认删除？')">删除</a>
                                </td>
                            </tr>
                        </c:forEach>
                        </thead>
                    </table>
                </div>
            </main>
        </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.9.0/feather.min.js"></script>
    <script src="/webshool/js/dashboard.js"></script>
</body>
</html>


